package com.example.weather.data

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query

/**
 * @author Y7993
 */
@Dao // 数据访问对象接口，用于与城市数据表进行交互
interface CityDao {
    @Insert
    fun insetCity(city: City?)

    @Query("delete from city")
    fun deleteAll()

    @Query("delete from city where name =:name")
    fun deleteByName(name: String?)

    @Query("select * from city")
    fun findAll(): MutableList<City?>?

    @Query("select * from city where name= :name")
    fun findByName(name: String?): City?
}
